
input_file = open('input/add_constraint_by_sequence.txt', mode='r', encoding='utf-8')
output_file = open('output/add_constraint_by_sequence.txt', mode='w', encoding='utf-8')

template = 'alter table %s add constraint %s unique (id);'

for line in input_file:
    row = line.rstrip()
    out = template % (row, 'UQ' + row[1:-4])
    output_file.write(out + '\n')
